package com.os.controller;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.os.model.DeskS;
import com.os.model.FoodS;
import com.os.model.UserM;
import com.os.service.SelectSuqiuServiceS;
import com.os.serviceimpl.SelectSuqiuServiceImplS;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

/**
 * 提交诉求前查询相关类容controller
 * @author 小H上午9:54:07
 *
 */
public class SelectSuqiuControllerS extends HttpServlet{
	SelectSuqiuServiceS s = new SelectSuqiuServiceImplS();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		req.setCharacterEncoding("utf8");
		resp.setCharacterEncoding("utf8");
		List<DeskS> dk = s.findDidS();
		List<DeskS> dk1 = s.findOidS();
		List<FoodS> dk2 = s.findFnameS();
		List<UserM> dk3 = s.findDnameS();
		List<UserM> dk4 = s.findJnameS();
		HttpSession session = req.getSession();
		session.setAttribute("dnum", dk);
		session.setAttribute("dnum1", dk1);
		session.setAttribute("dnum2", dk2);
		session.setAttribute("dnum3", dk3);
		session.setAttribute("dnum4", dk4);

	}
}
